load motorcommands.dat
angles = motorcommands(11:250:end,1:3);
angles = angles .* 180/pi
plot3(angles(1:124,1),angles(1:124,2),angles(1:124,3),'.')
hold on;plot3(angles(128:end,1),angles(128:end,2),angles(128:end,3),'r.')
legend('Training postures','Testing postures','FontSize',12)
xlabel('shoulder angle (degrees)','FontSize',12)
ylabel('deltoid angle (degrees)','FontSize',12)
zlabel('elbow angle (degrees)','FontSize',12)
test = angles(128:end,:)
ind=find(test(:,3)~=0)
test=test(ind,:)
train=angles(1:124,:)

angular_dist=min(dist(train,test'))

median(angular_dist)